<%@page import="com.ingenio.business.DetallePedido"%>
<%@page import="com.ingenio.business.DetalleMovimiento"%>
<%@page import="com.ingenio.dao.ControlCalidadAdapter"%>
<%@page import="com.ingenio.dao.MarcaAdapter"%>
<%@page import="com.ingenio.dao.SubRubroAdapter"%>
<%@page import="com.ingenio.dao.RubroAdapter"%>
<%@page import="com.ingenio.dao.CategoriaAdapter"%>
<%@page import="com.ingenio.business.Categoria"%>
<%@page import="com.ingenio.business.Rubro"%>
<%@page import="com.ingenio.business.SubRubro"%>
<%@page import="com.ingenio.business.Marca"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Aprobaci&oacute;n Control Calidad</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="Stock">
  <meta name="author" content="InGenio">

   <link href="css/bootstrap.min.css" rel="stylesheet">
   <link href="css/pedido.css" rel="stylesheet">
   <link href="css/principal.css" rel="stylesheet">

  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
  <![endif]-->

  <!-- Fav and touch icons -->
  <link rel="shortcut icon" href="img/favicon.png">
  
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <script type="text/javascript" src="js/bootstrap.min.js"></script>
  <script type="text/javascript" src="js/actualizacion_mercaderia.js"></script>
  <script type="text/javascript" src="js/notify.min.js"></script>
  <% ControlCalidadAdapter cca = new ControlCalidadAdapter();
  	 List<DetalleMovimiento> detalles = cca.devolverPedidosPendienteControl(null);
  %>
</head>

<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
          </button>
          <a class="navbar-brand" href="index.jsp">InGenio</a>
        </div>
      </div>
    </nav>
<div class="container container--menu">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<div class="page-header">
				<h1>Aprobaci&oacute;n de mercader&iacute;a en control de calidad</h1>
			</div>
			<div class="col-md-4">
				<div class="form-group form-inline">
	    			  <label for="inputNroPedido">Nro. Pedido: &nbsp; </label>
	    			  <input type="text" class="form-control" id="inputNroPedido">
	  			</div>
			</div>
			<div class="row clearfix col-md-2 p-bottom right m-right">
			   <label>Fecha</label>
			   <div class='input-group date' id='datetimepicker8'>
                    <input type='text' class="form-control uneditable-input " disabled/>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
                </span>
              </div>
            </div>
            <div class="clear"></div>
            
            <div class="todo">
            
			<table class="table table-striped table-fixedheader tablaCC">
			    <thead>
					<tr>
						<th width="5%">&nbsp;</th>
						<th width="10%">Pedido</th>
						<th width="10%">Fecha Pedido</th>
						<th width="10%">Producto</th>
						<th width="30%">Descripcion</th>
						<th width="10%">Recibidos</th>
						<th width="10%">Pendientes</th>
						<th width="10%">Recepcion</th>
						<th width="5%">&nbsp;</th>
					</tr>
				</thead>
				<tbody style="height:300px">
					<% for(DetalleMovimiento detalle: detalles){ %>
				   <tr>
				   		<td width="5%"><input type="checkbox" class="checkChild" name="checklist"></td>
				    	<td width="10%"><span><%=detalle.getMovimiento().getPedido().getIdPedido()%></span></td>
				    	<td width="10%"><span><%=detalle.getMovimiento().getPedido().getFechaPedido()%></span></td>
				    	<td width="10%"><span><%=detalle.getProducto().getIdProducto()%></span></td>
				    	<td width="30%"><%=detalle.getProducto().getDescProducto()%></td>
				    	<td width="10%"><span><%=detalle.getCantidadMov()%></span></td>
				    	<td width="10%"><input type="number" class="form-control input_cantidad" value="<%=detalle.getCantidadMov()%>" disabled></td>
				    	<td width="10%"><span><%=detalle.getMovimiento().getFechaMovimiento()%></span></td>
				    	<td width="5%"><a href="#" class="btn btn-inverse agregarMotivo" data-toggle="modal" data-target="#agregarMotivo"><i class="glyphicon glyphicon-pencil"></i></a ></td>
				   		<td style="display:none"><input type="hidden" class="movimiento" value="<%=detalle.getMovimiento().getIdMovimiento()%>"></td>
				   		<td style="display:none"><textarea class="motivoRechazo"></textarea></td>
				   </tr>
				   <% } %>
				 </tbody>
			</table>
						
			</div>
			<div class="clear"></div>
			
			<div class="">
				<div class="left">
					 <a href="index.jsp" class="btn btn-primary">Volver al menu</a>
					 <!-- toda esta parte es para la ventana modal de busqueda de productos -->
					 <div class="modal fade" id="agregarMotivo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					 	<div class="modal-dialog">
					 		<div class="modal-content">
					 			<div class="modal-header">
					 			 	<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					 			 	<h4>Desaprobar control de calidad</h4>
					 			</div>
					 			<div class="modal-body">
					 				<div class="row">
						 				<div class="col-md-12">
							 				<label for="id_pedido_modal" class="col-lg-2 control-label">Pedido: </label>
	    									<div class="col-lg-2">
	      										<span id="id_pedido_modal" class="">124</span>
	      									</div>
	      									<label for="id_producto_modal" class="col-lg-2 control-label">Producto: </label>
	    									<div class="col-lg-2">
	      										<span id="id_producto_modal" class="">1325</span>
	      									</div>
	      									<div class="col-lg-4">
	      										<span id="descripcion_producto_modal" class="">Al contrario del pensamiento popular, salchicha</span>
	      									</div>	
							 			</div>	
						 			</div>
						 			<p></p>
						 			<div class="row">
						 				<textarea class="form-control" rows="2" id="textMotivo"></textarea>
						 			</div>
 					 			</div>
					 			<div class="modal-footer">
					 			 <button type="button" class="btn btn-primary btnDesaprobarModal" data-dismiss="modal">Desaprobar</button>
					 			 <button type="button" class="btn btn-primary btnCloseModal" data-dismiss="modal">Salir</button>
					 			</div>
					 		</div>
					 	</div>
					 </div>
					 <!-- Fin de la ventana modal -->
				</div>
				<div class="right">
					 <button type="submit" class="btn btn-primary btnConfirmar">Confirmar</button>
					 <button type="button" class="btn btn-primary btnRefresh">Refrescar</button>
				</div>
			</div>
			<div class="clear"></div>
			
		</div>
	</div>
</div>
</body>
</html>